home *** CD-ROM | disk | FTP | other *** search
- /*
- $VER: CManager_UserAddress.rexx 1.0 (16.10.98) by Simone Tellini
- */
-
- options results /* enable return codes */
-
- if (left(address(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
-
- address 'GOLDED.1'
-
- 'LOCK CURRENT RELEASE=4' /* lock GUI, gain access */
-
- if (RC ~= 0) then
-
- exit
-
- options failat 6 /* ignore warnings */
-
- signal on syntax /* ensure clean exit */
-
- /* ---------------------- INSERT YOUR CODE HERE ---------------------- */
-
- if ~show("L","rxcmanager.library") then
- if ~addlib("rxcmanager.library",0,-30) then do
- say "no rxcmanager.library"
- exit
- end
-
- parse arg Search
-
- if Search = 'search' then do
-
- 'REQUEST STRING TITLE="Enter the name of the user to search for:" VAR=K'
-
- patt.Name = '#?'k'#?'
- patt.LastName = '#?'k'#?'
-
- num = CMFind("USER","REC","PATT",1)
-
- end
- else do
-
- call CMStart()
- num = CMGetEntry("USER MULTISELECT","REC")
- call CMClose()
- end
-
- if num > 0 then do
-
- do i=0 to num-1
-
- 'CR'
- 'FIRST'
-
- 'TEXT T="'rec.i.Name' 'rec.i.LastName'"'
- 'CR'
- 'FIRST'
-
- if rec.i.Address ~= '' then do
-
- addr = rec.i.Address
-
- newline = index( addr, '0a'x )
-
- do while newline ~= 0
-
- 'TEXT T="'left( addr, newline - 1 )'"'
- 'CR'
- 'FIRST'
-
- addr = right( addr, length( addr ) - newline )
-
- newline = index( addr, '0a'x )
- end
-
- 'TEXT T="'addr'"'
- 'CR'
- 'FIRST'
- end
-
- if rec.i.ZIP ~= '' || rec.i.City ~= '' then do
-
- space = 0
-
- if rec.i.ZIP ~= '' then do
- 'TEXT T="'rec.i.ZIP'"'
- space = 1
- end
-
- if rec.i.City ~= '' then do
-
- if space then 'TEXT T=" "'
-
- 'TEXT T="'rec.i.City'"'
- end
-
- 'CR'
- 'FIRST'
- end
-
- if rec.i.Country ~= '' then do
- 'TEXT T="'rec.i.Country'"'
- 'CR'
- 'FIRST'
- end
- end
- end
-
- /* ------------------------- END OF YOUR CODE ------------------------ */
-
- 'UNLOCK' /* unlock GUI */
-
- exit
-
- SYNTAX:
-
- SAY "Error in line" SIGL ":" ERRORTEXT(RC)
-
- 'UNLOCK'
-